<?php
$this->breadcrumbs=array(
	UserModule::t('Users')=>array('index'),
	'#'.$model->username,
);
?>

<div class="actions">
	<?php echo CHtml::link(UserModule::t('List User'), array('index'), array('class' => 'btn btn-small btn-success')); ?></li>
</div><!-- actions -->

<?php
	// For all users
	$attributes 	= array();
	$attributes[]	= array(
		'label'	=> 'Tên đăng nhập',
		'name'	=> 'username'
	);
	
	$profileFields=ProfileField::model()->forAll()->sort()->findAll();
	if ($profileFields)
	{
		foreach($profileFields as $field)
		{
			array_push($attributes,array(
				'label' => UserModule::t($field->title),
				'name' 	=> $field->varname,
				'value' => $model->profile->getAttribute($field->varname),
			));
		}
	}
	array_push($attributes,
		array(
			'name' => 'createtime',
			'value' => date("d/m/Y H:i:s",$model->createtime),
		),
		array(
			'name' => 'lastvisit',
			'value' => (($model->lastvisit)?date("d/m/Y H:i:s",$model->lastvisit):UserModule::t('Not visited')),
		)
	);
			
	$this->widget('bootstrap.widgets.TbDetailView', array(
		'type'=>'striped bordered condensed',
		'data'=>$model,
		'attributes'=>$attributes,
	));

?>
